<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>

    //if控制语句
    var a=1;
    if (a>0){
        alert(a)
    }
    //switch控制语句
    switch (a) {
        case 1:
            alert(a)
            break
        case 2:
            alert(a)
            break
        case 3:
            alert(a)
            break
        case 4:
            alert(a)
            break
        case 5:
            alert(a)
            break
        case 6:
            alert(a)
            break
        case 7:
            alert(a)
            break
        case 8:
            alert(a)
            break
        case 9:
            alert(a)
            break
        default:
            alert("不存在a值")
    }

    //for语句
    var sum=0;
    for (let i=0;i<=100;i++){
        sum+=i;
    }
    alert(sum)

    //while语句
    var i=0
    var sum=0
    while(i<=100){
        sum+=i
    }

    //do while 循环
    do {
        sum+=i
    }while (i<=100)
</script>
</body>
</html>